//RoboLite Motion Control

//USE_PWM flag setted in settings.h

#if USE_PWM
    #define     rl_forward()        rl_motor(254,254)  //01100000
    #define     rl_backward()       rl_motor_ex(-254,-254)  //10010000

    #define     rl_turnRight()      rl_motor(254,0)
    #define     rl_turnLeft()       rl_motor(0,254)
    //Fast version
    #define     rl_turnLeft_fast()  rl_motor_ex(-254,254)
    #define     rl_turnRight_fast() rl_motor_ex(254,-254)

    #define     rl_stop()           rl_motor(0,0)
    
    
    #warning "use pwm speed control"

#else
    //raw method
    #define     rl_forward()        PORTD=0b01100000  //01100000
    #define     rl_backward()       PORTD=0b10010000  //10010000


    #define     rl_turnRight()      PORTD=0b00100000
    #define     rl_turnLeft()       PORTD=0b01000000
    //Fast version
    #define     rl_turnLeft_fast()  PORTD=0b01010000
    #define     rl_turnRight_fast() PORTD=0b10100000

    #define     rl_stop()           PORTD=0x00
    

    #warning "use raw control"

    
#endif


#if USE_SOFT_PWM
void rl_move(int L,int R,uint T);
#endif

#if USE_PWM
void rl_motor(uchar left_speed,uchar right_speed);
void rl_motor_ex(int left_speed,int right_speed);
#endif

